<template>
  <li>{{i}}---{{v.name}}---{{v.comment}}
    <button @click.prevent="del">删除</button>
  </li>
</template>

<script>
  export default {
    name: "Item",
    props: ["v", "i", "remove"],
    methods: {
      del() {
        // 将item组件this 中的属性定义为一个个的变量
        const {v, i, remove} = this;
        this.remove(this.i);
      }
    }
  }
</script>

<style scoped>

</style>
